//
//  BaseModel.m
//  PhoenixNews
//
//  Created by dllo on 15/10/21.
//  Copyright (c) 2015年 Dior_3g. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

+ (NSMutableArray *)baseModelByArr:(NSArray *)arr {
    
    NSMutableArray *modelArr = [NSMutableArray array];
    
    for (NSDictionary *dic in arr) {
        
        @autoreleasepool {
            
            id model = [[self class] baseModelWithDic:dic];
            
            [modelArr addObject:model];
        }
        
    }
    return modelArr;
    
}


+ (instancetype)baseModelWithDic:(NSDictionary *)dic {
    
    id model = [[[self class] alloc] initWithDic:dic];
    
    return model;
}



- (instancetype)initWithDic: (NSDictionary *)dic {
    
    self = [super init];
    if (self) {

        [self setValuesForKeysWithDictionary:dic];
        
    }
    return self;
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

@end
